package club.pinea.util;

import java.util.HashMap;
import java.util.Map;

/**
 * proto类与command的映射
 */
public class ProtoCommandMap {

    private static Map<String, Integer> protoCommandMap = new HashMap<String, Integer>() {
        {
            put("HeartResponse", 1);
            put("HeartRequest", 2);

            put("LoginResponse", 100);
            put("LoginRequest", 101);

            put("RegisterResponse", 110);
            put("RegisterRequest", 111);

            put("UpdatePwdResponse", 120);
            put("UpdatePwdRequest", 121);


            put("RoomResponse", 200);
            put("RoomRequest", 201);

            put("SeatDownResponse", 210);
            put("SeatDownRequest", 211);

            put("LeaveSeatRequest", 231);
            put("LeaveSeatResponse", 230);

            put("UpdateRoomInfoRequest", 241);
            put("UpdateRoomInfoResponse", 240);

            put("StaySeatRequest", 251);
            put("StaySeatResponse", 250);

            put("GameAuthRequest", 301);
            put("GameAuthResponse", 300);

            put("GetCardRequest", 306);
            put("GetCardResponse", 305);

            put("ReplaceCardRequest", 311);
            put("ReplaceCardResponse", 310);

            put("DoubleCardRequest", 321);
            put("DoubleCardResponse", 320);

            put("GetScoreRequest", 331);
            put("GetScoreResponse", 330);

            put("SeatRecordsRequest", 341);
            put("SeatRecordsResponse", 340);

        }
    };

    /**
     * 获取order
     *
     * @param className
     * @return
     */
    public static Integer getCommand(String className) {
        return protoCommandMap.get(className);
    }

}
